package rt

import (
	"io"
	"kumachan/standalone/rpc"
	"kumachan/standalone/rpc/vd"
)

type RpcApi interface {
	rpc.StreamVdApi
	LookupService(rpc.ServiceIdentifier) (*RpcService, bool)
}
type RpcService struct {
	Interface      rpc.ServiceInterface
	MethodsImpl    map[string] rpc.ServiceMethodImpl
	DispatchTable  *DispatchTable
}

type VdApi interface {
	GetTypeFromId(id vd.TypeId) *vd.Type
	Serialize(v Value, t *vd.Type) ([] byte, error)
	Deserialize(binary ([] byte), t *vd.Type) (Value, error)
	SerializeToStream(v vd.Object, t *vd.Type, stream io.Writer) error
	DeserializeFromStream(t *vd.Type, stream io.Reader) (vd.Object, error)
}


